<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <template id="t1">
      <div>
        <button @click="hobby.push('git')">push</button>
        <button @click="hobby.pop()">pop</button>
        <button @click="hobby.shift()">shift</button>
        <button @click="hobby.unshift(Math.random())">unshift</button>
        <ul>
          <li v-for=" (h,i) in hobby" :key="h">{{i}}{{h}}</li>
        </ul>
      </div>
    </template>
    <script src="./vue.js"></script>
    <script>
      const vm = new Vue({
        el: "#app",
        template: "#t1",
        data: {
          hobby: ["vue", "css", "html", "js"],
        },
      });
    </script>
  </body>
</html>
